class StrategyController < ApplicationController
    def index
        @current_strategy = player.strategy.split("\n").join("<br>")
        @players = GAME_ENGINE.players
    end

    def player_info
        @status_information = player.status.split(',')
    end

    def commentary
      @commentary = GAME_ENGINE.commentary.reverse.first 20
    end
    
    def player
        GAME_ENGINE.get_player_by_name(session[:player_name])
    end
    private :player
    
    def update
        GAME_ENGINE.update_player_strategy session[:player_name], params[:strategy_description]
        puts params[:strategy_description]
        redirect_to :action => "index", :controller => 'strategy'
    end
end
